package myTeam.timeShop.bean;

// Generated 2016-3-28 15:22:59 by Hibernate Tools 3.2.2.GA



import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.NamedQueries;
import org.hibernate.annotations.NamedQuery;

import com.alibaba.fastjson.annotation.JSONField;
@NamedQueries({
	@NamedQuery(name="isExistByUserAccount",query="select count(*) from TbUser u where u.userAccount =?")
})
/**
 * Entity: 
 */
@Entity
@Table(name = "tb_user", catalog = "db_timeshop")
public class TbUser implements java.io.Serializable {

	/** 
	 * �û�id.
	 */

	private Integer userId;

	/** 
	 * �û��ʺ�.
	 */

	private String userAccount;

	/** 
	 * �û�����.
	 */

	private String userPassword;

	/** 
	 * �û�ͷ��·��.
	 */

	private String userFacePath;

	/** 
	 * �û��ǳ�.
	 */

	private String userName;

	/** 
	 * �û��Ա�һ��ע�᲻���޸�.
	 */

	private String userSex;

	/** 
	 * �û�����.
	 */

	private Date userBirthday;

	/** 
	 * �û�����ѧУ.
	 */

	private String userSchool;

	/** 
	 * �û��ȼ����㹫ʽ��ep=5*(0+1+2+....n) n=�ȼ���ep=����.
	 */

	private Integer userLevel;

	/** 
	 * �û�����ֵÿ���¼+1��������󷢲��߼�2������߼�5.
	 */

	private Integer userExperience;

	/** 
	 * �û����һ�ε�¼ʱ��.
	 */

	private Date userLastLoginTime;

	/** 
	 * �û�����ǩ��.
	 */

	private String userSign;

	private Set<TbDemand> tbDemandsForDemandClientId = new HashSet<TbDemand>(0);

	private Set<TbChar> tbCharsForCharFrom = new HashSet<TbChar>(0);

	private Set<TbLike> tbLikes = new HashSet<TbLike>(0);

	private Set<TbLike> tbLikes_1 = new HashSet<TbLike>(0);

	private Set<TbChar> tbCharsForCharTo = new HashSet<TbChar>(0);

	private Set<TbDemand> tbDemandsForDemandClientId_1 = new HashSet<TbDemand>(
			0);

	private Set<TbChar> tbCharsForCharFrom_1 = new HashSet<TbChar>(0);

	private Set<TbComment> tbComments = new HashSet<TbComment>(0);

	private Set<TbComment> tbComments_1 = new HashSet<TbComment>(0);

	private Set<TbChar> tbCharsForCharTo_1 = new HashSet<TbChar>(0);

	private Set<TbDemand> tbDemandsForDemandUserId = new HashSet<TbDemand>(0);

	private Set<TbDemand> tbDemandsForDemandUserId_1 = new HashSet<TbDemand>(0);
	
	private Set<TbRequest> tbRequests = new HashSet<TbRequest>(0);

	public TbUser() {
	}

	public TbUser(String userAccount, String userPassword, String userFacePath,
			String userName, String userSex, Date userBirthday,
			String userSchool, Integer userLevel, Integer userExperience,
			Date userLastLoginTime, String userSign,
			Set<TbDemand> tbDemandsForDemandClientId,
			Set<TbChar> tbCharsForCharFrom, Set<TbLike> tbLikes,
			Set<TbLike> tbLikes_1, Set<TbChar> tbCharsForCharTo,
			Set<TbDemand> tbDemandsForDemandClientId_1,
			Set<TbChar> tbCharsForCharFrom_1, Set<TbComment> tbComments,
			Set<TbComment> tbComments_1, Set<TbChar> tbCharsForCharTo_1,
			Set<TbDemand> tbDemandsForDemandUserId,
			Set<TbDemand> tbDemandsForDemandUserId_1,
			Set<TbRequest> tbRequest ) {
		setUserAccount(userAccount);
		setUserPassword(userPassword);
		setUserFacePath(userFacePath);
		setUserName(userName);
		setUserSex(userSex);
		setUserBirthday(userBirthday);
		setUserSchool(userSchool);
		setUserLevel(userLevel);
		setUserExperience(userExperience);
		setUserLastLoginTime(userLastLoginTime);
		setUserSign(userSign);
		setTbDemandsForDemandClientId(tbDemandsForDemandClientId);
		setTbCharsForCharFrom(tbCharsForCharFrom);
		setTbLikes(tbLikes);
		setTbLikes_1(tbLikes_1);
		setTbCharsForCharTo(tbCharsForCharTo);
		setTbDemandsForDemandClientId_1(tbDemandsForDemandClientId_1);
		setTbCharsForCharFrom_1(tbCharsForCharFrom_1);
		setTbComments(tbComments);
		setTbComments_1(tbComments_1);
		setTbCharsForCharTo_1(tbCharsForCharTo_1);
		setTbDemandsForDemandUserId(tbDemandsForDemandUserId);
		setTbDemandsForDemandUserId_1(tbDemandsForDemandUserId_1);
		setTbRequests(tbRequest);
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "user_id", unique = true, nullable = false)
	public Integer getUserId() {
		return this.userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	@Column(name = "user_account", length = 20)
	public String getUserAccount() {
		return this.userAccount;
	}

	public void setUserAccount(String userAccount) {
		this.userAccount = userAccount;
	}

	@Column(name = "user_password", length = 50)
	public String getUserPassword() {
		return this.userPassword;
	}

	public void setUserPassword(String userPassword) {
		this.userPassword = userPassword;
	}

	@Column(name = "user_face_path", length = 200)
	public String getUserFacePath() {
		return this.userFacePath;
	}

	public void setUserFacePath(String userFacePath) {
		this.userFacePath = userFacePath;
	}

	@Column(name = "user_name", length = 20)
	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@Column(name = "user_sex", length = 2)
	public String getUserSex() {
		return this.userSex;
	}

	public void setUserSex(String userSex) {
		this.userSex = userSex;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "user_birthday", length = 19)
	public Date getUserBirthday() {
		return this.userBirthday;
	}

	public void setUserBirthday(Date userBirthday) {
		this.userBirthday = userBirthday;
	}

	@Column(name = "user_school", length = 20)
	public String getUserSchool() {
		return this.userSchool;
	}

	public void setUserSchool(String userSchool) {
		this.userSchool = userSchool;
	}

	@Column(name = "user_level")
	public Integer getUserLevel() {
		return this.userLevel;
	}

	public void setUserLevel(Integer userLevel) {
		this.userLevel = userLevel;
	}

	@Column(name = "user_experience")
	public Integer getUserExperience() {
		return this.userExperience;
	}

	public void setUserExperience(Integer userExperience) {
		this.userExperience = userExperience;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "user_last_login_time", length = 19)
	public Date getUserLastLoginTime() {
		return this.userLastLoginTime;
	}

	public void setUserLastLoginTime(Date userLastLoginTime) {
		this.userLastLoginTime = userLastLoginTime;
	}

	@Column(name = "user_sign", length = 100)
	public String getUserSign() {
		return this.userSign;
	}

	public  void setUserSign(String userSign) {
		this.userSign = userSign;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbUserByDemandClientId")
	@JSONField(serialize=false)
	public   Set<TbDemand> getTbDemandsForDemandClientId() {
		return this.tbDemandsForDemandClientId;
	}

	public  void setTbDemandsForDemandClientId(
			Set<TbDemand> tbDemandsForDemandClientId) {
		this.tbDemandsForDemandClientId = tbDemandsForDemandClientId;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbUserByCharFrom")
	@JSONField(serialize=false)
	public  Set<TbChar> getTbCharsForCharFrom() {
		return this.tbCharsForCharFrom;
	}

	public  void setTbCharsForCharFrom(Set<TbChar> tbCharsForCharFrom) {
		this.tbCharsForCharFrom = tbCharsForCharFrom;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbUser")
	@JSONField(serialize=false)
	public  Set<TbLike> getTbLikes() {
		return this.tbLikes;
	}

	public  void setTbLikes(Set<TbLike> tbLikes) {
		this.tbLikes = tbLikes;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbUser")
	@JSONField(serialize=false)
	public  Set<TbLike> getTbLikes_1() {
		return this.tbLikes_1;
	}

	public  void setTbLikes_1(Set<TbLike> tbLikes_1) {
		this.tbLikes_1 = tbLikes_1;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbUserByCharTo")
	@JSONField(serialize=false)
	public   Set<TbChar> getTbCharsForCharTo() {
		return this.tbCharsForCharTo;
	}

	public   void setTbCharsForCharTo(Set<TbChar> tbCharsForCharTo) {
		this.tbCharsForCharTo = tbCharsForCharTo;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbUserByDemandClientId")
	@JSONField(serialize=false)
	public  Set<TbDemand> getTbDemandsForDemandClientId_1() {
		return this.tbDemandsForDemandClientId_1;
	}

	public  void setTbDemandsForDemandClientId_1(
			Set<TbDemand> tbDemandsForDemandClientId_1) {
		this.tbDemandsForDemandClientId_1 = tbDemandsForDemandClientId_1;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbUserByCharFrom")
	@JSONField(serialize=false)
	public  Set<TbChar> getTbCharsForCharFrom_1() {
		return this.tbCharsForCharFrom_1;
	}

	public  void setTbCharsForCharFrom_1(Set<TbChar> tbCharsForCharFrom_1) {
		this.tbCharsForCharFrom_1 = tbCharsForCharFrom_1;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbUser")
	@JSONField(serialize=false)
	public  Set<TbComment> getTbComments() {
		return this.tbComments;
	}

	public   void setTbComments(Set<TbComment> tbComments) {
		this.tbComments = tbComments;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbUser")
	@JSONField(serialize=false)
	public  Set<TbComment> getTbComments_1() {
		return this.tbComments_1;
	}

	public  void setTbComments_1(Set<TbComment> tbComments_1) {
		this.tbComments_1 = tbComments_1;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbUserByCharTo")
	@JSONField(serialize=false)
	public  Set<TbChar> getTbCharsForCharTo_1() {
		return this.tbCharsForCharTo_1;
	}

	public  void setTbCharsForCharTo_1(Set<TbChar> tbCharsForCharTo_1) {
		this.tbCharsForCharTo_1 = tbCharsForCharTo_1;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbUserByDemandUserId")
	@JSONField(serialize=false)
	public  Set<TbDemand> getTbDemandsForDemandUserId() {
		return this.tbDemandsForDemandUserId;
	}

	public  void setTbDemandsForDemandUserId(
			Set<TbDemand> tbDemandsForDemandUserId) {
		this.tbDemandsForDemandUserId = tbDemandsForDemandUserId;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbUserByDemandUserId")
	@JSONField(serialize=false)
	public  Set<TbDemand> getTbDemandsForDemandUserId_1() {
		return this.tbDemandsForDemandUserId_1;
	}

	public  void setTbDemandsForDemandUserId_1(
			Set<TbDemand> tbDemandsForDemandUserId_1) {
		this.tbDemandsForDemandUserId_1 = tbDemandsForDemandUserId_1;
	}
	
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbUser")
	@JSONField(serialize=false)
	public Set<TbRequest> getTbRequests() {
		return this.tbRequests;
	}

	public void setTbRequests(Set<TbRequest> tbRequests) {
		this.tbRequests = tbRequests;
	}
}
